package net.uman.service;

import java.util.ArrayList;
import java.util.List;

import net.uman.dao.ArticleDao;
import net.uman.dao.ResourceDao;
import net.uman.entity.Article;
import net.uman.entity.Resource;
import net.uman.entity.User;
import net.uman.framework.modules.orm.Page;
import net.uman.framework.modules.orm.PropertyFilter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ResourceManager extends Manager {
	//在上传附件AttachmentUploadServlet中，要使用到
	public static final String SPRING_BEAN_NAME = "resourceManager";
	@Autowired
	private ResourceDao resourceDao;
	
	public Page<Resource> getResourcePage(Page<Resource> page,List<PropertyFilter> filters){
		return resourceDao.findPage(page, filters);
	}
	/**
	 * 添加资源
	 * @param resource
	 */
	public void addResource(Resource resource) {
		resourceDao.save(resource);
	}
	public List<Resource> getResourceList() {
		return resourceDao.getAll();
	}
	
}
